from todo_api_protect.base.mybase import Tools


class reg_model(Tools):
    # 定义路径
    path = '/user/register'

    # 发送注册请求
    def reg_action(self, usr, pwd, cpwd, email, check='1234'):
        reg_data = {
            "username": usr,
            "password": pwd,
            "cpassword": cpwd,
            "checkcode": check,
            "email": email
        }
        reg = self.meeting.post(url=self.hosturl+self.path, data=reg_data)
        return reg.json()


# import requests
# s = requests.session()
# reg1 = reg_model(meeting=s)
# msg = reg1.reg_action(usr='admin10023', pwd='admin123', cpwd='admin123', check='1234', email='admin1dfg@qq.com')
# print(msg)
